Interactive system for automatically synthesizing a content-aware fill

ABSTRACT

Embodiments of the present invention provide systems, methods, and computer storage media for automatically synthesizing a content-aware fill using similarity transformed patches. A user interface receives a user-specified hole and a user-specified sampling region, both of which may be stored in a constraint mask. A brush tool can be used to interactively brush the sampling region and modify the constraint mask. The mask is passed to a patch-based synthesizer configured to synthesize the fill using similarity transformed patches sampled from the sampling region. Fill properties such as similarity transform parameters can be set to control the manner in which the fill is synthesized. A live preview can be provided with gradual updates of the synthesized fill prior to completion. Once a fill has been synthesized, the user interface presents the original image, replacing the hole with the synthesized fill.

BACKGROUND

When editing images, a user may desire to remove an unwanted object froman image. For example, a photograph may include an unwanted subject,visual artifacts such as those resulting from damage or digital effects,and the like. However, simply deleting an unwanted region leaves a holein the image. Some digital image processing tools can automatically fillthe hole with translated patches sampled from other regions of theimage. For example, some tools use a randomized algorithm to identifyapproximate nearest neighbor matches between image patches. As such,some tools can construct a composite fill from the translated imagepatches. In this manner, users can automatically fill in missing partsof an image.

SUMMARY

Embodiments of the present invention are directed to an interactivesystem for automatically synthesizing a content-aware fill usingsimilarity transformed patches. The interactive system includes a userinterface which allows a user to specify a hole and a sampling region touse to fill the hole. The user interface is configured to present theoriginal image with an overlay indicating the sampling region of theoriginal image. A brush tool can be provided to facilitate a user inputadding to or subtracting from the sampling region. The sampling regioncan be stored in a constraint mask that identifies the sampling region.Upon detecting completion of the user input, the interactive system canautomatically pass the resulting constraint mask to a patch-basedsynthesizer configured to synthesize a fill using similarity transformedpatches sampled from the sampling region specified by the constraintmask. In some embodiments, the user interface can present a preview ofwhat the fill will look like prior to completion. The preview can be alive preview providing gradual updates of the fill generated by thepatch-based synthesizer. Once a fill has been synthesized, the userinterface presents the original image, replacing the hole with thesynthesized fill.

In some embodiments, the user interface can facilitate a user inputspecifying one or more fill properties, such as similarity transformparameters (e.g., parameters specifying or otherwise indicating validranges for rotations, scaling factor, mirroring and/or translations ofcandidate patches), color adaption (e.g., gain and/or bias),deterministic fill synthesis, and the like. The fill properties can beset to control the manner in which the patch-based synthesizersynthesizes the fill.

In some embodiments, the patch-based synthesizer can utilize an improvedpatch validity test to validate candidate patches as valid patchesfalling within the designated sampling region. A hole dilation test forpatch validity can be performed by dilating the hole in the samplingregion to generate a reduced sampling region, and by performing a lookupto determine whether a representative pixel in the patch (e.g., thecenter pixel) falls within the reduced sampling region. A patch whichpasses this test is designated valid. A no-dilation test for patchinvalidity can be performed by looking up whether a representative pixelof a patch (e.g., the center pixel) falls within the hole. A patch whichsatisfies this criteria is designated invalid. A comprehensive pixeltest for patch validity can be performed by looking up whether eachpixel in the patch falls within the sampling region. Advantageously,only those patches whose validity cannot be determined using either ofthe former two tests are evaluating using the comprehensive pixel test.A patch whose pixels pass the comprehensive pixel test is designatedvalid, while a patch whose pixels fail the comprehensive pixel test isdesignated invalid. In some embodiments, a fringe test for rangeinvalidity can be performed as a precursor to any or all of the improvedpatch validity tests. The fringe test can be performed by adding afringe indicating an invalid range to the boundary of the source image.Range invalidity for a particular pixel can be determined by looking upwhether the pixel falls within the fringe. A patch with a pixel with aninvalid range is designated as an invalid patch. Generally, thepatch-based synthesizer uses validated patches to synthesize the fill.

As such, using implementations described herein, a user can efficientlyand effectively synthesize content-aware fills.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is described in detail below with reference to theattached drawing figures, wherein:

FIG. 1 is an example image, before and after applying a conventionalcontent-aware fill;

FIG. 2 is a block diagram of an exemplary computing system forautomatically synthesizing a content-aware fill, in accordance withembodiments of the present invention;

FIG. 3 illustrates an example content-aware fill workspace, inaccordance with embodiments of the present invention;

FIG. 4 is an example image with an automatically synthesizedcontent-aware fill, in accordance with embodiments of the presentinvention;

FIG. 5 is an example image with an automatically synthesizedcontent-aware fill, in accordance with embodiments of the presentinvention;

FIGS. 6A-6C are example images illustrating an automatically synthesizedcontent-aware fill, in accordance with embodiments of the presentinvention; FIG. 6A depicts an original image with a constraint maskoverlay; FIG. 6B is an example image with an automatically synthesizedcontent-aware fill with mirroring off and color adaptation on; FIG. 6Cis an example image an automatically synthesized content-aware fill withmirroring on and color adaptation off;

FIG. 7 illustrates an example content-aware fill workspace with anautomatically synthesized content-aware fill using a default samplingregion, in accordance with embodiments of the present invention;

FIG. 8 illustrates an example content-aware fill workspace with anautomatically synthesized content-aware fill using a customized samplingregion, in accordance with embodiments of the present invention;

FIG. 9 illustrates examples of valid and invalid patches, in accordancewith embodiments of the present invention;

FIG. 10 illustrates a hole dilation test for patch validity, inaccordance with embodiments of the present invention;

FIG. 11 illustrates a no-dilation test for patch invalidity, inaccordance with embodiments of the present invention;

FIG. 12 illustrates a comprehensive pixel test for patch validity, inaccordance with embodiments of the present invention;

FIG. 13 illustrates a fringe test for range invalidity, in accordancewith embodiments of the present invention;

FIG. 14 illustrates examples of randomly generated transforms, inaccordance with embodiments of the present invention;

FIG. 15 is a flow diagram showing a method for automaticallysynthesizing a target image to fill a hole in an original image,according to various embodiments of the present invention;

FIG. 16 is a flow diagram showing a method for automaticallysynthesizing a target image to fill a hole in an original image,according to various embodiments of the present invention;

FIG. 17 is a flow diagram showing a method for patch validity testing,according to various embodiments of the present invention;

FIG. 18 is a flow diagram showing a method for patch validity testing,according to various embodiments of the present invention;

FIG. 19 is a block diagram of an exemplary computing environment inwhich embodiments of the invention may be employed; and

FIG. 20 is a block diagram of an exemplary computing environmentsuitable for use in implementing embodiments of the present invention.

DETAILED DESCRIPTION

The patent or application file contains at least one drawing executed incolor. Copies of this patent or patent application publication withcolor drawing(s) will be provided by the Office upon request and paymentof the necessary fee.

Overview

Oftentimes during photo editing, a user may desire to remove an unwantedobject from an image. One conventional tool to accomplish this is acontent-aware fill (“CAF”) tool. Generally, a CAF tool might allow theuser to select, highlight, draw or otherwise indicate an unwanted regionof the image. Conventional content-aware fill techniques remove theunwanted region and automatically fill the resulting hole using samplesfrom other parts of the image. A CAF algorithm seeks to approximatelyreconstruct a target image (e.g., the hole) by rearranging and piecingtogether (with overlaps) small, square patches of pixels from a sourceimage (e.g., a sampling region). CAF seeks to identify an approximatematching patch (i.e., the nearest neighbor) from the sampling region foreach patch of a target image (i.e., the hole to fill). Candidate patchesfrom the source image are selected, tested, and refined in an iterativemanner. The resulting reconstruction can fill the hole in the way thatmakes it look like the unwanted object was never there.

However, conventional content-aware fill tools suffer from variousdrawbacks. For example, conventional CAF techniques are limited in themanner by which candidate patches are identified. Conventionaltechniques search for candidate patches over a continuous translationdomain, and candidate patches are identified by the 2D translation thatmaps a patch in the target image (hole) to the corresponding candidatepatch in the source image (sampling region). By limiting candidatepatches to 2D translations, the potential quality of the reconstructedtarget image is limited. However, CAF techniques are alreadycomputationally expensive, and simply expanding the search domainresults in an unacceptable increase in computation time. As such, thereis a need for improved image completion quality with reducedcomputational demands.

Moreover, in a substantial number of cases, the hole is filled with thewrong image content, producing an awkward and unnatural result. FIG. 1illustrates this issue. FIG. 1 depicts an example image of a flower witha bee collecting pollen, before and after applying a conventionalcontent-aware fill technique. To remove the bee from the image, a usermight specify boundary 110 surrounding the bee to identify a holeenclosed by boundary 110 as the region to fill. As will be appreciated,the generated fill in region 120 is inaccurate. For example, the textureof the flower petals is inconsistent and blurred, and some parts of thehole were incorrectly filled with the green background. This result isobviously undesirable.

Many users find these results particularly frustrating considering otherlimitations of conventional CAF techniques. For example, there arecurrently no ways for users to identify a sampling region or to controlparameters of the search domain. Moreover, conventional content-awarefills are not deterministic, often resulting in structurally differentfills from run to run. As a result, conventional techniques often do notproduce an accurate preview. In practice, users would simply repeat theprocess, generating multiple fills until achieving a desired result.Considering the computationally expensive nature of the conventionalCAF, this repetitive process is time-consuming and frustrating. As such,there is a need for an improved user interface to facilitate a moreefficient user experience.

Accordingly, embodiments of the present invention are directed to aninteractive system for automatically synthesizing a content-aware fill.The interactive system includes a user interface which allows a user tospecify a hole and a sampling region to use to fill the hole. Thesampling region, which generally excludes the hole, can be stored in aconstraint mask. A brush tool can facilitate a user input adding to orsubtracting from the sampling region. Upon detecting completion of theuser input, the interactive system can automatically pass the resultingconstraint mask to a back end content-aware fill engine to synthesize acontent-aware fill using the specified constraint mask. Additionallyand/or alternatively, the user interface can facilitate a user inputspecifying one or more fill properties for a content-aware fill, such asrotation adaptation, scaling, mirroring, color adaptation, and/ordeterministic fill. In some embodiments, the user interface can includea results panel that includes a preview of what the fill will look likeprior to completion. The preview can be a live preview providing gradualupdates of the fill generated by the content-aware fill engine. Asexplained in more detail below, a preview can be generated and/orupdated after an iteration (e.g., after each iteration) of a patch-basedsynthesizer process.

Some embodiments disclosed herein are directed to an improved patchvalidity test for patch-based synthesis applications. The introductionof patch rotations and scaling increases the complexity of determiningwhether a candidate patch is a valid patch falling within the samplingregion. To test the validity of a given patch comprising multiplepixels, one or more of a series of simplified tests can be performed todetermine whether each pixel of the patch falls within the samplingregion (e.g., designated by a constraint mask). A hole dilation test forpatch validity can be performed by dilating the hole in the constraintmask to generate a reduced constraint mask, and by performing a lookupto determine whether a representative pixel in the patch falls withinthe region designated by the reduced constraint mask. A patch whichpasses this test is valid. A no-dilation test for patch invalidity canbe performed by looking up whether a representative pixel of a patchfalls within the hole (e.g., falls outside of the sampling regiondesignated by the constraint mask). A patch which satisfies thiscriteria is invalid. A comprehensive pixel test for patch validity canbe performed by looking up whether each pixel in the patch falls withinthe sampling region designated by the constraint mask. Due to therelatively larger computational demands of this comprehensive pixeltest, advantageously, only those patches whose validity cannot bedetermined using either of the other two tests are tested with thecomprehensive pixel test. A patch whose pixels pass the comprehensivetest is valid. One or more of the patch validity tests can beincorporated into the interactive system for automatically synthesizinga content-aware fill.

In some embodiments, one or more of the patch validity tests can beenhanced by using a fringe test for range invalidity. Sometimes acandidate patch can be generated with one or more pixels with invalidcoordinates falling outside of an image, for example, due to theintroduction of patch rotations. However, when accessing a datastructure (e.g., to lookup whether a particular pixel falls within amask), the access must be valid and within the allocated block of memoryfor that structure. Conventionally, conditional range tests areperformed to determine whether each pixel to be tested has a validrange. In some embodiments, conditional range tests can be replaced witha fringe test for range invalidity. The fringe test can be performed byadding a fringe to the boundary of the image indicating an invalidrange. As such, range invalidity for a particular pixel under test canbe determined by looking up whether the pixel falls within the fringe.In some embodiments, the fringe can be added as an invalid region to amask such as the constraint mask. Advantageously, the fringe test forrange invalidity is performed as a precursor to each patch validitytest.

As such, using implementations described herein, a user can efficientlyand effectively synthesize content-aware fills. Among the improvementsover conventional techniques, the front end user interface allows a userto customize a sampling region and fill properties to optimize acontent-aware fill based on image content. A live preview providesgradually updating results, providing a user with quick, real-timefeedback and an earlier opportunity to make changes and arrive at adesired fill. The back end content-aware fill engine provides expandedsupport for similarity transforms, thereby improving fill quality.Improved patch validity tests significantly reduce the computationalcomplexity required to support this expanded functionality. Thesetechniques can be used to synthesize better, faster fills.

Having briefly described an overview of aspects of the presentinvention, various terms used throughout this description are provided.Although more details regarding various terms are provided throughoutthis description, general descriptions of some terms are included belowto provider a clearer understanding of the ideas disclosed herein:

Patch synthesis—Some digital image processing tools can automaticallysynthesize a target image from patches sampled from other regions of theimage. Generally, patch synthesis refers to this reconstruction of atarget image from patches sampled from a source image. In the context ofhole filling, the target image to be synthesized can be a hole in animage, and the source image—or sampling region—can be the rest of theimage, or some portion thereof. One particular patch synthesis techniqueuses a randomized algorithm to identify approximate nearest neighbormatches between image patches and constructs a composite fill from theidentified image patches. Such techniques for identifying approximatenearest neighbor matches are also known as patch matching, and theresulting composite fill is also known as a content-aware fill.

Hole—Sometimes, a photograph or other image includes some unwantedobject, such as an unwanted subject, visual artifacts such as thoseresulting from damage or digital effects, and the like. However, simplydeleting an unwanted region would leave a hole in the image. As usedherein, “hole” can refer to the region of the image to be filled,regardless of whether the region has actually been deleted. Similarly,“hole” can refer to a corresponding invalid sampling region in a masksuch as a constraint mask.

Mask—As used herein, a mask is one or more data structures that identifyand/or designate certain pixels for a particular use. For example, amask can be initialized with the same dimensions as an original image tobe edited. The mask can identify pixels in a hole to be filled, pixelsin a valid sampling region, pixels in a reduced region, pixels in afringe, and the like. In one example, a user selection can be used togenerate a constraint mask designating a valid sampling region in animage. In one implementation, the constraint mask can encode a state foreach pixel, such as pixels in a valid sampling region (e.g., using anarbitrary number such as 1, the value of the pixel, etc.), pixels in aninvalid sampling region (e.g., 0), pixels in a hole, pixels in auser-specified constraint, etc. Other variations will be understood bythose of ordinary skill in the art.

Similarity transform—Generally, a similarity transform is ashape-preserving transform that can include one or more translation,rotation, scaling and/or reflection (i.e., mirroring).

Image pyramid—An image pyramid will be understood as a multi-scalerepresentation of an image. An original image is subsampled to produce asmaller, lower (courser) resolution image. This resulting image isitself subsampled to produce yet another smaller, lower resolutionimage. This process can be repeated to produce multiple representationsof different scales. If the images were stacked with the smaller, lowerresolution scales on top and the larger, higher resolution scales on thebottom, the resulting multi-scale collection would resemble a pyramid.

Exemplary Automated Patch Synthesis Environment

Referring now to FIG. 2, a block diagram of exemplary environment 200suitable for use in implementing embodiments of the invention is shown.Generally, environment 200 is suitable for image editing, and, amongother things, facilitates automatically synthesizing a content-awarefill. Environment 200 includes user device 210 having photo editingapplication 220 with user interface 235 and content-aware fill engine260. User device 210 can be any kind of computing device capable offacilitating image editing. For example, in an embodiment, user device210 can be a computing device such as computing device 2000, asdescribed below with reference to FIG. 20. In embodiments, user device210 can be a personal computer (PC), a laptop computer, a workstation, amobile computing device, a PDA, a cell phone, or the like. Userinterface 235 is in communication with content-aware fill engine 260.Generally, user interface 235 allows a user to customize any number ofinput parameters to facilitate content-aware fill engine 260automatically synthesizing a content-aware fill.

In the embodiment illustrated by FIG. 2, user device 210 includes userinterface 230 and content-aware fill engine 260. User interface 230and/or content-aware fill engine 260 may be incorporated, or integrated,into an application or an add-on or plug-in to an application, such asphoto editing application 220. Photo editing application 220 maygenerally be any application capable of facilitating photo or imageediting. Application 220 may be a stand-alone application, a mobileapplication, a web application, or the like. In some implementations,the application(s) comprises a web application, which can run in a webbrowser, and could be hosted at least partially server-side. Inaddition, or instead, the application(s) can comprise a dedicatedapplication. In some cases, the application can be integrated into theoperating system (e.g., as a service). One exemplary application thatmay be used for photo editing is ADOBE® PHOTOSHOP®, which is a graphicsediting application. Although generally discussed herein as user device210 and/or content-aware fill engine 260 being associated with anapplication, in some cases, user device 210 and/or and content-awarefill engine 260, or some portion thereof, can be additionally oralternatively integrated into the operating system (e.g., as a service)or a server (e.g., a remote server).

Generally, user interface 230 is an interactive software interface thatallows a user to customize various input parameters for an automaticsynthesis of a content-aware fill. In FIG. 2, user interface 230includes original image panel 235, results panel 240, brush tool 245 andfill properties panel 250. Generally, original image panel 235 presentsan original image, and accepts a user selection of a first region of theoriginal image to be filled and/or a user selection of a second regionof the original image to be used as a sampling region. Brush tool 245 isan input tool that allows a user to interactively brush the samplingregion indicated in original image panel 235 to customize the samplingregion. Fill properties panel 250 presents and accepts a selection ofvarious fill properties, such as overlay settings for the samplingregion, fill settings such as similarity transform parameters forcandidate patches, and output settings for the synthesized fill. Resultspanel 240 presents a preview of what the fill will look like prior tocompletion of the fill.

Generally, user interface 230 can allow a user to specify an originalimage for editing. In some embodiments, user interface 230 provides anoption (e.g., a menu command) to trigger a content-aware fill workspacesuch as content-aware fill workspace 300 depicted in FIG. 3. FIG. 3illustrates an example layout of a user interface 230. In thisembodiment, content-aware fill workspace 300 includes original imagepanel 305 (which can correspond to original image panel 235 of FIG. 2),results panel 340 (which can correspond to results panel 240 of FIG. 2),and fill properties panel 350 (which can correspond to fill propertiespanel 250 of FIG. 2).

Original image panel 305 includes original image 310 (which, in thisexample, is the same photograph of the flower and bee from FIG. 1). Aregion of the image to be filled may be user-specified, automaticallygenerated, some combination thereof, or otherwise. For example,content-aware fill workspace 300 can provide a selection tool with whicha user can specify a hole boundary such as hole boundary 320. Originalimage panel 305 can overlay hole boundary 320 on top of original image310 to provide an indication of the region of original image 305 to befilled. Hole boundary 320 and/or the region within hole boundary 320(i.e., the hole) can be stored in one or more data structures indicatingthe region to be filled. Additionally and/or alternatively, the boundaryand/or hole can be stored in one or more data structures indicating avalid sampling region, such as a constraint mask. More specifically, theconstraint mask can designate the hole as an invalid region forsampling. The sampling region from which pixels can be sampled for thecontent-aware fill may be user-specified, automatically generated, somecombination thereof, or otherwise. The sampling region may beinitialized to a default region (e.g., excluding the hole) that may becustomized, for example, by a user input modifying the default region.The sampling region can be stored in one or more data structuresindicating a valid sampling region, such as the constraint mask. Morespecifically, the constraint mask can designate the sampling region as avalid region for sampling.

In some embodiments, original image panel 305 can include an overlay toindicate the sampling region. For example, original image panel 305includes constraint mask overlay 330. Overlay settings may be definedand/or customizable, for example, via fill properties panel 350. Forexample, customizable overlay settings can include a toggled display,color and/or opacity of constraint mask overlay 330. Additionally and/oralternatively, an option may be provided for constraint mask overlay 330to depict the sampling region or to depict the excluded region oforiginal image 310 which will not be used for sampling. In the exampleillustrated in FIG. 3, constraint mask overlay 330 is toggled on,transparent, red, and depicts the sampling region.

Fill properties panel 350 (which can correspond to fill properties panel250 of FIG. 2) can present and accept a selection of various fillproperties, such as overlay settings for the sampling region, fillsettings such as similarity transform parameters for candidate patches,and output settings for the synthesized fill. Generally, the fillproperties can be set to control the manner in which the fill issynthesized. For example, customizable fill settings can includesimilarity transform parameters (e.g., parameters specifying orotherwise indicating valid ranges for rotations, scaling factor,mirroring and/or translations of candidate patches), color adaption(e.g., gain and/or bias), deterministic fill synthesis, and the like.Customizable fill settings are discussed in greater detail below.Customizable output settings can include a designated output layer forthe synthesized fill. For example, outputting to the current layerreplaces the hole pixels in the current layer with the synthesized fill,outputting to a new layer outputs the synthesized fill to a separatelayer (e.g., with transparency around it), and/or outputting to aduplicate layer copies the original image into a duplicate layer andreplaces the hole pixels with the synthesized fill in the duplicatelayer. Other variations for fill properties will be apparent to those ofordinary skill in the art.

Generally, content-aware fill workspace 300 can automatically pass theconstraint mask and/or designated fill properties to a back endcomponent such as content-aware fill engine 260 at any time tosynthesize (or begin synthesizing) a content-aware fill using theconstraint mask. For example, content-aware fill workspace 300 canautomatically pass the constraint mask and/or designated fill propertiesto content-aware fill engine 260 upon content-aware fill workspace 300being triggered, upon a selection of original image 310, upon aselection or modification to the hole boundary and/or the samplingregion (e.g., via brush tool 245, a lasso tool, a polygonal lasso tool,an expand selection tool, a shrink selection tool, etc.), upon aselection or modification of a fill property, upon an authorization toproceed (e.g., an OK button click), and/or some other criteria. In theevent a constraint mask is passed before a user selection of a holeboundary and/or sampling region, the constraint mask can be initializedto some default state (which may include, for example, an automaticallydetected region, a region or selection carried over from some other fillor prior iteration, a default region, etc.).

Content-aware fill workspace 300 includes results panel 340, which caninclude a preview of the synthesized fill prior to completion. A previewmatching the final result can be generated by content-aware fill engine260 operating on the full resolution original image 310. As described ingreater detail below, content-aware fill engine 260 implements aniterative process to construct and refine a fill. Each successiveiteration produces a solution with improved detail and generallyconsistent image structure (e.g., lines and curves in the image). Apreview can be derived from this same process used to arrive at the fullsolution. By starting with the full resolution original image 310 (asopposed to conventional techniques which operate on a thumbnail togenerate a preview) and using a fill solution after an iteration as apreview, an accurate preview can be generated matching the imagestructure of the end result, unlike conventional previews. Accordingly,content-aware fill engine 260 can pass the fill solution after aniteration (e.g., after each iteration) to results panel 340 forpresentation to the user. In some embodiments, content-aware fill engine260 can perform successive iterations and provide the solution toresults panel 340 after each iteration. As such, results panel 340 caninclude a live preview with gradually updating results. These gradualupdates can provide a user with quick, real-time feedback and an earlieropportunity to make any desired changes to arrive at a desired fill.

In some embodiments, content-aware fill engine 260 can provide a previewand break the process before subsequent iterations to facilitate a userinput prior to completing the fill. For example, before generating apreview, content-aware fill workspace 300 can permit a user to select adesired preview resolution and/or dimension (or a default previewresolution can be utilized). Content-aware fill engine 260 can beginsynthesizing a fill and break after an iteration in which the resolutionof the corresponding current fill solution matches the designatedpreview resolution within a predetermined threshold (whether specifiedin pixels, as a percentage, or otherwise). In these embodiments,content-aware fill engine 260 can pass the current fill to results panel340 for presentation as a preview. In this scenario, content-aware fillworkspace 300 can prompt a user for an indication to continueprocessing, to change parameters and/or to zoom into or out of thepreview.

A user indication to continue processing can trigger content-aware fillengine 260 to compute the remaining resolutions, up to thefull-resolution result. However, a change in the hole or samplingregion, or a change in similarity transform parameters for candidatepatches, can render the current fill obsolete. Some existingcomputations can be salvaged to improve speed and avoid unnecessaryrecomputations. For example, if one or more masks are not impacted by achange, the masks need not be recomputed. Likewise, pyramidscorresponding to the unchanged masks need not be regenerated. If theuser does not change the hole, there is no need to recompute a bufferstoring a distance transform from each pixel to the hole boundary.Various calculations such as these and others can be cached andreutilized to improve processing speed, as will be understood by thoseof ordinary skill in the art.

Another possibility at a break is a user request to zoom in or out of apreview. Since content-aware fill engine 260 already computed lowerresolution solutions to arrive at the preview, those solutions can becached, and accessed and presented in the event a user zooms out of thepreview (e.g., requests a lower resolution preview). If a user zoomsinto the preview (e.g., requests a higher resolution preview),content-aware fill workspace 300 can pass an indication to content-awarefill engine 260 to resume the computation from the previous resolutionwhere it was last paused, in order to produce the next previewresolution. This approach leverages prior iterations and permitscontent-aware fill engine 260 to quickly generate the new preview forthe front end.

In some embodiments, an incorrect fill can be improved by dividing ahole into two or more sub-divisions and incrementally synthesizing afill for each sub-division. For example, content-aware fill workspace300 can accept an input manually identifying a first sub-division, and afill can be generated as described above. Content-aware fill workspace300 can accept an input (e.g., a button press) indicating the fillshould be accepted, upon which content-aware fill workspace 300 canfacilitate a subsequent input manually identifying a subsequentsub-division, and the process repeated. Additionally and/oralternatively to accepting inputs manually identifying sub-divisions,the sub-divisions can be automatically generated, as will be understoodby those of ordinary skill in the art. In some embodiments,content-aware fill workspace 300 can accept an input indicating that themost recently generated fill should be used to generate a fill for asubsequent sub-division. In this manner, content-aware fill workspace300 can fill a hole by incrementally generating fills for two or moresub-divisions of the hole.

The foregoing discussion utilized FIG. 3 to illustrate examplecontent-aware fill workspace 300 with original image panel 305, resultspanel 340, and fill properties panel 350. In FIG. 3, original image 310is the image of a flower with a bee collecting pollen. Results panel 340depicts an example fill generated utilizing translations for candidatepatches. As will be appreciated, the resulting fill is inaccurate. Forexample, the texture of the flower petals is inconsistent and blurred,and some parts of the hole were incorrectly filled with the greenbackground. For images with non-linear features, the quality of the fillcan be improved by expanding the search domain to include similaritytransformations for candidate patches. For example, fill settings suchas similarity transform parameters may enable rotations, scaling, and/ormirroring. The fill settings may be preset, customizable for interactiveaccess, or otherwise.

FIGS. 4-8 illustrate some of the potential benefits resulting frominteractive access to customizable fill settings and/or a customizablesampling region. As a general matter, synthesizing fills usingsimilarity transforms for candidate patches, as opposed to simply usingtranslations, can significantly improve fill quality. However, eachimage is different, so different types of transforms may be moreappropriate for particular images. For example, rotations may beappropriate for curved objects or perspective images. Moreover,rotations with limited ranges may be appropriate in certaincircumstances. Generally, rotation adaptation can be used to specify thedegree (or range) to which patches can rotate when filling the hole aspart of a patch synthesis. For example, preset fill settings may bedesignated (e.g., low, medium, high, full) corresponding to a range ofpotential rotations. Full rotations (e.g., −180° to 180°) may beappropriate for round or circular objects. Some intermediate degree ofrotation may be appropriate for images with significant amounts ofcurvature. Some lower degree of rotation may be appropriate for imageswith curved lines like a bend in a road. In another example, scaling maybe appropriate to improve a synthesized fill for image content withrepeating patterns of different sizes, or under perspective. Mirroring(e.g., a flip such as a horizontal flip) can improve a synthesized fillfor images with symmetry. Color adaptation can be used to specify gainand/or bias strength to improve a synthesized fill for images bychanging brightness and/or contrast of patches used to fill the hole aspart of a patch synthesis. By allowing a user to select an appropriatefill setting, a user can guide the patch synthesis to an optimalsolution.

Returning to the example image of a flower with a bee collecting pollen,FIGS. 4 and 5 depict examples of automatically synthesized content-awarefills using different fill settings. Since the flower in original image310 is generally circular, rotation adaptation can be applied tocandidate patches to rotate flower petals to fill the hole. FIG. 4illustrates an automatically synthesized content-aware fill usingrotation adaptation. The resulting fill no longer includes portions ofthe green background, so the flower appears more natural. The result canbe further improved by including mirroring. FIG. 5 illustrates anautomatically synthesized content-aware fill using mirroring. In FIG. 5,the texture of the resulting fill has been improved to more closelymatch the texture of the remaining flower petals.

FIGS. 6A-6C are example images illustrating an automatically synthesizedcontent-aware fill, in accordance with embodiments of the presentinvention. FIG. 6A depicts a portion of an original image with womanwalking into a hallway. To remove the woman from the image, the dottedregion has been selected as a hole boundary, and the constraint maskoverlay excludes the hole. FIG. 6A has been zoomed in, so the originalimage, the overlay, and the corresponding sampling region are notdepicted in their entirety. FIG. 6B is an example image with anautomatically synthesized content-aware fill generated with mirroringoff and color adaptation on. As can be seen, the hole has been filledincorrectly (e.g., the hallway wall has been improperly extended). Sincethe original image includes symmetry, mirroring can be utilized toimprove the fill. As such, FIG. 6C is an example image with anautomatically synthesized content-aware fill generated with mirroring onand color adaptation off. As can be seen, the fill quality has beenimproved by using samples from a symmetric portion of the original imageand by turning off gain and bias adjustments.

In addition and/or in the alternative to providing customizablesimilarity transform parameters, another customizable fill setting is adeterministic fill synthesis mode. Conventional patch synthesistechniques are generally multi-threaded. More specifically, a designatedhole can be split it into several files for parallel processing bydifferent threads. The timing with which the threads finalize theirrespective solutions can change the resulting fill solution for thedesignated hole. Since this timing is not known or controlled inconventional techniques, conventional patch synthesis generally is notrepeatable. In a deterministic fill synthesis mode, a repeatable patchsynthesis technique can be implemented, as explained in more detailbelow. However, since this deterministic process may increase processingtime, allowing the user to control this mode permits the user perform atradeoff between speed and repeatability.

In addition and/or in the alternative to providing customizable fillsettings, a customizable sampling region can be used to improve anautomatically synthesized fill. FIGS. 7 and 8 illustrate potentialbenefits from utilizing a customizable sampling region. FIG. 7illustrates an example content-aware fill workspace with anautomatically synthesized content-aware fill using a default samplingregion. The original image panel on the left illustrates an originalimage with a brown building to be removed. The dotted region around thebrown building has been selected as the hole, and a default samplingregion illustrated by the red overlay has been initialized, excludingthe hole. In the results panel on the right, the automaticallysynthesized content-aware fill has incorrectly sampled from a corner ofa white building in the center of the original image. In this example,instead of eliminating the brown building, the resulting fillincorrectly replaced the brown building with a portion of the whitebuilding. To adjust the resulting fill, the sampling region can becustomized.

Generally, a content-aware fill workspace can facilitate a usercustomizing the sampling region. For example, the content-aware fillworkspace may provide an input tool such as a brush tool (e.g., brushtool 245) that allows a user to interactively brush the sampling regionin original image panel 235 to customize the sampling region. The brushtool can facilitate a user input adding to or subtracting from a validsampling region, which may be stored in a constraint mask. The brushtool may be resizable to increase or decrease the brush size.Additionally and/or alternatively, the shape of the capture region ofthe brush tool may be customizable to any shape. As such, the brush toolcan be used to add or remove from the sampling region. Additionallyand/or alternatively, various other input tools can be provided tofacilitate a user selection and/or modification of a hole and/or asampling region, such as a lasso tool, a polygonal lasso tool, an expandselection tool, a shrink selection tool, and the like. In someembodiments, upon detecting completion of a user input (such as a brushstroke removing pixels from the sampling region and/or correspondingoverlay), the content-aware fill workspace can automatically pass theresulting sampling region (e.g., via a constraint mask) to a back endcomponent such as content-aware fill engine 260 to synthesize acontent-aware fill using the specified constraint mask. FIG. 8illustrates an example content-aware fill workspace with anautomatically synthesized content-aware fill using a customized samplingregion. As will be appreciated, sampling region and correspondingoverlay have been customized with a constraint excluding the whitebuildings in the center of the original image. The resulting fill in theresults panel on the right properly replaces the brown building withpixels from the sky and trees in the original image, instead of from thecorner of the white building.

Returning now to FIG. 2, content-aware fill engine 260 includes patchvalidity component 265 and patch-based synthesizer 270. Patch validitycomponent 265 and patch-based synthesizer 270 operate in communicationto automatically synthesize a content-aware fill (e.g., to fill a holeindicated by a constraint mask passed from user interface 235). Asexplained in more detail below, patch-based synthesizer 270 may performa patch synthesis using a randomized algorithm to generate and evaluatecandidate patches and identify approximate nearest neighbor matchesbetween image patches. This can involve an iterative process ofinitialization, searching, voting and upscaling for each scale of amulti-scale solution, as will be understood by those of ordinary skillin the art. Candidate patches may be generated from a source image(e.g., the sampling region designated by a constraint mask) duringinitialization, search, and upsampling. Generally, patch validitycomponent 265 evaluates the validity of candidate patches by applyingone or more improved patch validity tests. Advantageously, each timepatch-based synthesizer 270 identifies a candidate patch, patch validitycomponent 265 determines the validity of the patch.

Generally, the introduction of patch rotations and scaling increases thecomplexity of determining whether a candidate patch is a valid patchfalling within the sampling region. FIG. 9 illustrates examples of validand invalid patches. In FIG. 9, sampling region 910 excludes hole 920.To sample valid patches from sampling region 910, the patches shouldfall entirely within the sampling region. Patches 930, 940 and 950 areexample patches illustrated with a width of three pixels each forillustration purposes. Patch 930 falls entirely within sampling region910, so patch 930 is valid. Patch 940 includes some pixels from hole930, so patch 940 is invalid. Patch 950 includes some pixels that falloutside of sampling region 910, so patch 950 is invalid. This lattersituation might occur when the border of the sampling region coincideswith the border of the original image, and applying a rotation togenerate a candidate patch results in some pixels of the candidate patchfalling outside of the original image. Patch validity component 265 candetermine patch validity under these scenarios.

To test the validity of a similarity transformed patch with a width of kpixels, conventional techniques simply evaluate whether each pixel iswithin the sampling region. This essentially involves a matrixmultiplication for each pixel in the patch. The complexity of thisoperation is O(k²). The complexity can be reduced without compromisingquality by using one or more simplified tests: (1) a hole dilation testfor patch validity, (2) a no dilation test for patch invalidity, and (3)a comprehensive pixel test for patch validity.

During patch synthesis iterations at finer image pyramid resolutionswhere speed matters the most, the center of many randomly generatedcandidate patches do not touch the hole. As such, a determination ofpatch validity in this scenario can be simplified by evaluating whethera representative pixel of a candidate patch such as the center pixelfalls within a reduced sampling region with a dilated hole. The hole canbe dilated by a factor that accounts for patch width, allowabletransformations and/or super sampling. This test is referred to as ahole dilation test for patch validity and is illustrated by FIG. 10. InFIG. 10, hole 1020 is dilated to form dilated hole 1025. The width ofdilated strip 1022 may be based on patch width, allowed patch rotations,a maximum allowed scaling factor, and/or the super sampling rate. Forexample, the width of dilated strip 1022 may be given by the followingequation:

Dilated strip width=(√{square root over (2)}*half patch width)*(supersampling rate)*(max scaling factor)  (1)

In this example, the √{square root over (2)} factor can be derived asthe maximum pixel displacement from the patch center over the allowedpatch rotations, as will be understood by those of ordinary skill in theart. Moreover, the half pitch width is advantageously rounded to aninteger (e.g., for a patch width of 7 pixels, the half patch width canbe 3 pixels). As such, in some embodiments, the dilated strip width canbe varied depending on the allowed patch rotations.

Dilated hole 1025 can be used to generate reduced sampling region 1010.For example, where a constraint mask is used to encode the samplingregion, the hole in the constraint mask can be dilated to generate areduced constraint mask. The hole dilation test for patch validity canbe performed by looking up whether the representative pixel in the patch(e.g., patch 1030) falls within the region designated by the reducedconstraint mask (e.g., reduced sampling region 1010). A patch whichpasses this test is valid. Advantageously, no conclusion is drawn forpatches which do not pass the test. The complexity of the hole dilationtest for patch validity is O(1). By implementing the hole dilation testfor patch validity, the speed of patch synthesis has been observed toincrease by 1.6× over matrix multiplication with O(k²).

During patch synthesis iterations at courser image pyramid resolutions,the center of many randomly generated candidate patches (e.g., NNF fieldinitialization, search, and upsampling) touches the hole. As such, adetermination of patch invalidity in this scenario can be simplified byevaluating whether a representative pixel of a candidate patch such asthe center pixel falls within the hole. This is referred to as ano-dilation test for patch invalidity and is illustrated by FIG. 11. InFIG. 11, a determination of whether patch 1130 falls within hole 1120can be performed by looking up whether a representative pixel such asthe center pixel falls within the hole. The test can be performed in theinverse by determining whether the representative pixel falls outside ofsampling region 1110. A patch which satisfies this criteria is invalid.Advantageously, no conclusion is drawn for patches which do not satisfythis criteria. The complexity of the no-dilation test for patchinvalidity is O(1). By implementing the no-dilation test for patchinvalidity, the speed of patch synthesis has been observed to increaseby 1.15× over matrix multiplication with O(k²).

Applying the hole dilation test for patch validity and the no-dilationtest for patch invalidity will not conclusively determine patch validityfor candidate patches whose center pixel falls within the dilated strip.As such, a determination of patch validity can be performed in someinstances by looking up whether each pixel in a candidate patch fallswithin the sampling region (e.g., designated by the constraint mask).This is referred to as comprehensive pixel test for patch validity andis illustrated by FIG. 12. In FIG. 12, each pixel of patch 1230 istested to determine whether it falls within sampling region 1210 and isthus outside of hole 1220. Due to the relatively larger computationaldemands of this comprehensive pixel test, advantageously only thosepatches whose validity cannot be determined using either of the holedilation test for patch validity or the no-dilation test for patchinvalidity are tested with the comprehensive pixel test. A patch thatpasses the comprehensive pixel test is valid, while a patch that failsthe comprehensive pixel test is invalid. It is possible to maximizespeed and facilitate more efficient hardware usage by calculating thepixel coordinates for each pixel in a given patch row with one fusedmultiple-add (FMA) vector instruction, as will be understood by those ofordinary skill in the art. By processing each patch row pixelcoordinates calculation as a vector, the complexity of the comprehensivepixel test for patch validity is improved to O(k), as opposed to matrixmultiplication with O(k²).

In some embodiments, one or more of the patch validity tests can beenhanced by using a fringe test for range invalidity. Sometimes acandidate patch can be generated with one or more pixels with invalidcoordinates (e.g., falling outside of an image or other initialized datastructure), for example, due to the introduction of patch rotations.However, when accessing a data structure (e.g., to lookup whether aparticular pixel falls within the constraint mask), the access must bevalid and within the allocated block of memory for that structure.Conventionally, four conditional range tests can be performed todetermine whether each pixel to be tested has a valid range (e.g., onetest for each of four image boundaries). Instead of the four conditionalrange tests, the fringe test for range invalidity can be performed tosimplify range testing.

Generally, a fringe test for range invalidity can be performed by addinga fringe around the boundary of a valid region (e.g., the image) toindicate an invalid range. As such, range invalidity for a particularpixel to be tested can be determined by looking up whether the pixelfalls within the fringe. FIG. 13 illustrates a fringe test for rangeinvalidity. In FIG. 13, fringe 1350 is added around image boundary 1310.Width 1312 of fringe 1350 may be based on patch width, allowed patchrotations, a maximum allowed scaling factor, and/or the super samplingrate. For example, the width of fringe 1350 may be given by equation (1)above. The fringe test for range invalidity can be performed by lookingup whether a pixel (e.g., from patch 1330) falls within the fringe(e.g., fringe 1350). In some embodiments, the fringe can be added as aninvalid region to a mask such as the constraint mask. If a pixel fallswithin the fringe, it has an invalid range, and its patch is invalid.The complexity of the fringe test for range invalidity is O(1), reducingthe O(4) complexity of the four conventional conditional range tests bya factor of four for each application of the fringe test (e.g., eachlookup).

The fringe test for range invalidity can be incorporated into one ormore (e.g., all) of the patch validity tests. For example, in FIG. 13,assuming a pixel of patch 1330 is to be tested to look up whether itfalls within a reduced sampling region (e.g., during a hole dilationtest for patch validity), within hole 1320 (e.g., during a no dilationtest for patch invalidity) and/or within a valid sampling region (e.g.,during comprehensive pixel test for patch validity), the fringe test forrange invalidity can be applied to determine whether the pixel undertest has a valid range before performing each lookup. Since the holedilation and no dilation tests comprise one lookup each, and thecomprehensive pixel test comprises k² lookups, utilizing the fringe testcan reduce the complexity of range testing by a factor of four for eachof the hole dilation and no-dilation tests, and by a factor of 4k² forthe comprehensive pixel test.

Generally, one or more of the improved patch validity tests can beincorporated into an interactive system for automatically synthesizing acontent-aware fill. For example, in the embodiment illustrated in FIG.2, patch validity component 265 can evaluate the validity of candidatepatches for patch-based synthesizer 270 by applying one or more improvedpatch validity tests. Use of the improved validity tests describedherein has been observed to increase the speed of patch synthesis byalmost 1.75× over matrix multiplication techniques with O(k²). For 90%of the candidate patches tested, the improved patch validity testsdescribed herein determined patch validity using a single lookup withO(1).

In the example implementation depicted in FIG. 2, patch-basedsynthesizer 270 performs a patch synthesis using a randomized algorithmto generate and evaluate candidate patches and identify approximatenearest neighbor matches between image patches. To construct a given atarget image (e.g., a hole) using image patches transformed from asource image, a data structure called a nearest neighbor field (NNF) canbe used to manage mappings between patches in the source and targetimages. The NNF includes a transform for each pixel in the target image.As described herein, these transforms may include similarity transforms.For a given pixel, the transform in the NNF for that pixel identifies acorresponding source patch which can be tested for similarity to atarget patch associated with the pixel. The goal of patch-basedsynthesizer 270 is to identify a source patch (e.g., from a validsampling region) that best matches each target patch (i.e., the nearestneighbor). The NNF field can be updated during various stages of thesynthesis process to keep track of the nearest neighbor source patch foreach target patch.

Patch-based synthesizer 270 can involve an iterative process ofinitialization, searching, voting and upscaling for each scale of amulti-scale solution, as will be understood by those of ordinary skillin the art. As such, in the embodiment illustrated by FIG. 2,patch-based synthesizer 270 includes corresponding initializationcomponent 272, propagation search component 274, random search component276, voting component 278 and upscaling component 280.

For each target pixel from a target image (e.g., a hole), initializationcomponent 272 assigns a randomly generated transform as aninitialization. FIG. 14 illustrates examples of randomly generatedtransforms that identify candidate patches from source image B (e.g.,patches 1425, 1435) which can be used as corresponding target patchesfor target image A (e.g., patches 1420, 1430). As described herein,these transforms may include similarity transforms. Similarity transformparameters may be user-selected, pre-determined, some combinationthereof, or otherwise. Generally, the randomly generated transforms arebounded over the applicable similarity transform parameters (e.g.,translation, scale, rotation and/or mirror search domains).Advantageously, patch validity component 265 determines the validity ofeach candidate patch. For candidate source patches that fail the patchvalidity test, initialization component 272 assigns a new randomlygenerated transform to replace the failed candidate patch, and the patchvalidity test is repeated. If a patch validity test fails somepredetermined amount of times (e.g., 256), a candidate patch may begenerated by reducing the valid sampling region (e.g., dilating thehole), bounding the corresponding search domain and/or by using arandomly generated simple translation, rather than a full similaritytransform. As such, this alternative technique can be utilized togenerate a valid candidate patch.

Generally, patch-based synthesizer 270 performs searching (e.g., viapropagation search component 274 and random search component 276) toidentify candidate patches that improve the NNF, as will be understoodby those of ordinary skill in the art. Advantageously, patch validitycomponent 265 determines the validity of each candidate patch. If acandidate source patch fails a patch validity test, the candidate patchis not utilized to improve the NNF. Candidate patches that pass patchvalidity are evaluated to determine whether a given candidate patch is acloser match for a particular target patch than an existing nearestneighbor in the NNF (e.g., whether a candidate patch reduces patchdistance). In other words, NNF=Min(NNF, Previous NNF).

In some embodiments, propagation search component 274 and random searchcomponent 276 can identify candidate patches in a manner thatfacilitates a deterministic fill synthesis. In conventional techniques,a designated hole can be split up into several sub-divisions forparallel processing by different threads. In one example, a hole mightbe split up into three sub-divisions, and each of three threadsprocesses a corresponding sub-division in parallel. In conventionaltechniques, a particular thread processes each pixel in an allocatedsub-division in scanline order. For example, for a given pixel,propagation search component 274 propagates solutions for neighboringpixels and selects the best solution, random search component 276identifies solutions for randomly identified pixels and selects the bestsolution, and the assigned thread moves onto the next pixel in scanlineorder. However, because some threads may finish generating a fill for anassigned sub-division faster than other threads, often times fills aregenerated for a sub-division using patches sampled from an incompletefill for a neighboring sub-division. As a result, conventional patchsynthesis generally is not repeatable.

As such, in some embodiments, a designated hole can be split up intomore sub-divisions than threads, and multiple threads can be allocatedto only process non-bordering sub-divisions in parallel. In a simpleexample, assume a hole is split into six blocks, 0-5. For eveniterations of patch-based synthesizer 270, three threads can processalternating blocks (e.g., 0, 2, 4) in scanline order. During odditerations, the threads can process alternating blocks in reversescanline order (e.g., 1,3,5). Because neighboring sub-divisions havecompleted fills by the time any thread finishes processing a particularsub-division, the timing by which each thread finishes processing itsallocated sub-division does not matter. As such, allocating multiplethreads to process non-bordering sub-divisions in parallel can producedeterministic results.

In some embodiments, a wavefront technique can be applied to identifycandidate patches to facilitate a deterministic fill synthesis.Generally, wavefront processing is a technique for processing amultidimensional grid for which a particular unit in the grid dependsupon other units in the grid. By starting in a corner, processingproceeds in a diagonal sweep across the grid which resembles awavefront. In the context of a patch-based synthesis, searching can beimplemented utilizing a wavefront instead of in scanline order (e.g.,propagation search component 274 can propagate solutions for aneighboring pixel above and for a neighboring pixel to the left).Further, a random number generator utilized by random search component276 to randomly identified pixels can be modified. Random numbergenerators are usually designed to generate a known sequence of uniformnumbers when given a seed. For wavefront processing to produce adeterministic patch synthesis, the random number generator can bemodified to accept <x, y, patch-based synthesizer iteration, randomsearch iteration> as its input to generate a uniform number. In thismanner, for a given <x,y> pixel value, a given sequence of calls to therandom number generator will produce the same results. In this manner, adeterministic set of candidate patches can be identified, facilitating adeterministic fill synthesis. Other variations will be understood bythose of ordinary skill in the art.

Generally, patch-based synthesizer 270 performs voting (e.g., via votingcomponent 278) to generate a proposed target image. Generally,patch-voting is performed to accumulate the pixel colors of eachoverlapping neighbor patch, and the color votes are weighted averaged.The proposed target image can be passed to the front end (e.g., reviewpanel 240) for presentation as a preview. As described above, duringeach subsequent iteration, the proposed target image is updated, and theupdated target image can be passed to the front end for each iteration.The result is a gradually updating, live preview. These gradual updatescan provide a user with quick, real-time feedback and an earlieropportunity to make any desired changes to arrive at a desired fill.

Patch-based synthesizer 270 performs upscaling (e.g., via upscalingcomponent 280) to upscale the current NNF for use as a baseline during asubsequent iteration at the next scale. As this upscaling can produceinvalid patches, patch validity component 265 advantageously determinesthe validity of candidate patches corresponding to the upscaled NNF.Candidate patches that pass patch validity are evaluated during asubsequent patch-based synthesizer 270 iteration to determine whether agiven candidate patch is a closer match for a particular target patchthan a corresponding candidate patch generated from a randomlyinitialized NNF.

Generally, the flow through patch-based synthesizer 270 is repeated forsubsequent pyramid scales until a full resolution solution is generatedand passed to the front end for presentation to a user. In someembodiments, patch-based synthesizer 270 can break upon some componentdetecting an updated (e.g. by the user) sampling region and/or anapplicable translation, scale, rotation and/or mirror search domain. Inthis scenario, patch-based synthesizer 270 can salvage existingcomputations to improve speed and avoid unnecessary recomputations, asdescribed in more detail above, and may automatically begin processingthe updated sampling region and/or search domain. Additionally and/oralternatively, patch-based synthesizer 270 can pass a proposed targetimage for presentation as a preview and break its process to facilitatea user input prior to completing the fill, as described in more detailabove. A user indication to continue processing can trigger patch-basedsynthesizer 270 to compute the remaining resolutions, as described inmore detail above.

As such, using implementations described herein, a user can efficientlyand effectively synthesize content-aware fills. Among the improvementsover conventional techniques, the front end user interface allows a userto customize a sampling region and fill properties to optimize acontent-aware fill based on image content. A live preview providesgradually updating results, providing a user with quick, real-timefeedback and an earlier opportunity to make changes and arrive at adesired fill. The back end content-aware fill engine provides expandedsupport for similarity transforms, thereby improving fill quality.Improved patch validity tests significantly reduce the computationalcomplexity required to support this expanded functionality. Thesetechniques can be used to synthesize better, faster fills.

Although techniques are described herein with respect to imagecompletion in the context of photo editing, the present techniques maybe applied to any hole-filling algorithm based on hole-fillingapplication based on example-based optimization. Moreover, althoughimproved patch validity tests are described herein with reference to ahole-fitting application, in some embodiments, one or more improvedpatch validity tests may be applied in various other implementations,including imagery targeting, brushables, image reshuffling, contentremoval, dense correspondence algorithms (NRDC), image morphing,supersolution, denoising, deblurring, and the like. Theseimplementations are merely exemplary, and other implementations will beunderstood by those of ordinary skill in the art.

Exemplary Flow Diagrams

With reference now to FIGS. 15-18, flow diagrams are providedillustrating methods for various techniques described herein. Each blockof the methods 1500, 1600, 1700 and 1800 and any other methods describedherein comprises a computing process performed using any combination ofhardware, firmware, and/or software. For instance, various functions canbe carried out by a processor executing instructions stored in memory.The methods can also be embodied as computer-usable instructions storedon computer storage media. The methods can be provided by a standaloneapplication, a service or hosted service (standalone or in combinationwith another hosted service), or a plug-in to another product, to name afew.

Turning initially to FIG. 15, FIG. 15 illustrates a method 1500 forautomatically synthesizing a target image to fill a hole in an originalimage, according to various embodiments described herein. Initially atblock 1510, a user interface is provided. The user interface isconfigured to receive a first user input specifying a hole in anoriginal image to be filled. The user interface is also configured toreceive a second user input indicating a sampling region of the originalimage from which pixels can be sampled, the sampling region excludingthe hole. At block 1520, the sampling region is stored in a constraintmask. At block 1530, the constraint mask is passed to a patch-basedsynthesizer configured to synthesize a target image from similaritytransformed patches sampled from the sampling region specified by theconstraint mask. At block 1540, the user interface presents the originalimage with the synthesized target image filling the hole.

Turning now to FIG. 16, FIG. 16 illustrates a method 1600 forautomatically synthesizing a target image to fill a hole in an originalimage, according to various embodiments described herein. Initially atblock 1610, a constraint mask is accessed. The constraint mask specifiesa customizable sampling region of an original image from which pixelscan be sampled. The sampling region excludes a user-specified hole inthe original image. At block 1620, a target image is synthesized to fillthe hole from similarity transformed patches sampled from the samplingregion specified by the constraint mask. At block 1630, the synthesizedtarget image is provided for presentation of the original image with thesynthesized target image filling the hole.

Turning now to FIG. 17, FIG. 17 illustrates a method 1700 for patchvalidity testing, according to various embodiments described herein.Initially at block 1710, a similarity transformed candidate patch isgenerated for reconstructing a target image. The candidate patchcomprises pixels from a source image. At block 1720, the candidate patchis validated as a valid patch falling within a sampling region of thesource image based on an evaluation of a representative pixel of thesimilarity transformed candidate patch. At block 1730, the target imageis automatically reconstructed using the validated candidate patch.

Turning now to FIG. 18, FIG. 18 illustrates a method 1800 for patchvalidity testing, according to various embodiments described herein.Initially at block 1820, candidate patch 1810 is tested using a holedilation test for patch validity. If test 1820 is satisfied, conclusion1830 is drawn that candidate patch 1810 is a valid patch. If test 1820is not satisfied, candidate patch 1810 is tested at block 1840 using ano dilation test for patch invalidity. If test 1840 is satisfied,conclusion 1850 is drawn that candidate patch 1810 is an invalid patch.If test 1840 is not satisfied, candidate patch 1810 is tested at block1860 using a comprehensive pixel test for patch validity. If test 1860is satisfied, conclusion 1870 is drawn that candidate patch 1810 is avalid patch. If test 1860 is not satisfied, conclusion 1880 is drawnthat candidate patch 1810 is an invalid patch.

Exemplary Computing Environment

FIG. 19 is a diagram of environment 1900 in which one or moreembodiments of the present disclosure can be practiced. Environment 1900includes one or more user devices, such as user devices 1902A-1902N.Examples of user devices include, but are not limited to, a personalcomputer (PC), tablet computer, a desktop computer, cellular telephone,a processing unit, any combination of these devices, or any othersuitable device having one or more processors. Each user device includesat least one application supported by creative apparatus 1908. It is tobe appreciated that following description may generally refer to userdevice 1902A as an example and any other user device can be used.

A user of the user device can utilize various products, applications, orservices supported by creative apparatus 1908 via network 1906. Userdevices 1902A-1902N can be operated by various users. Examples of theusers include, but are not limited to, creative professionals orhobbyists who use creative tools to generate, edit, track, or managecreative content, advertisers, publishers, developers, content owners,content managers, content creators, content viewers, content consumers,designers, editors, any combination of these users, or any other userwho uses digital tools to create, edit, track, or manage digitalexperiences.

A digital tool, as described herein, includes a tool that is used forperforming a function or a workflow electronically. Examples of adigital tool include, but are not limited to, content creation tool,content editing tool, content publishing tool, content tracking tool,content managing tool, content printing tool, content consumption tool,any combination of these tools, or any other tool that can be used forcreating, editing, managing, generating, tracking, consuming orperforming any other function or workflow related to content. A digitaltool includes creative apparatus 1908.

Digital experience, as described herein, includes experience that can beconsumed through an electronic device. Examples of the digitalexperience include content creating, content editing, content tracking,content publishing, content posting, content printing, content managing,content viewing, content consuming, any combination of theseexperiences, or any other workflow or function that can be performedrelated to content.

Content, as described herein, includes electronic content. Examples ofthe content include, but are not limited to, image, video, website,webpage, user interface, menu item, tool menu, magazine, slideshow,animation, social post, comment, blog, data feed, audio, advertisement,vector graphic, bitmap, document, any combination of one or morecontent, or any other electronic content.

User devices 1902A-1902N can be connected to creative apparatus 1908 vianetwork 1906. Examples of network 1906 include, but are not limited to,internet, local area network (LAN), wireless area network, wired areanetwork, wide area network, and the like.

Creative apparatus 1908 includes one or more engines for providing oneor more digital experiences to the user. Creative apparatus 1908 can beimplemented using one or more servers, one or more platforms withcorresponding application programming interfaces, cloud infrastructureand the like. In addition, each engine can also be implemented using oneor more servers, one or more platforms with corresponding applicationprogramming interfaces, cloud infrastructure and the like. Creativeapparatus 1908 also includes data storage unit 1912. Data storage unit1912 can be implemented as one or more databases or one or more dataservers. Data storage unit 1912 includes data that is used by theengines of creative apparatus 1908.

A user of user device 1902A visits a webpage or an application store toexplore applications supported by creative apparatus 1908. Creativeapparatus 1908 provides the applications as a software as a service(SaaS), or as a standalone application that can be installed on userdevice 1902A, or as a combination. The user can create an account withcreative apparatus 1908 by providing user details and also by creatinglogin details. Alternatively, creative apparatus 1908 can automaticallycreate login details for the user in response to receipt of the userdetails. In some embodiments, the user is also prompted to install anapplication manager. The application manager enables the user to manageinstallation of various applications supported by creative apparatus1908 and also to manage other functionalities, such as updates,subscription account and the like, associated with the applications.User details are received by user management engine 1916 and stored asuser data 1918 in data storage unit 1912. In some embodiments, user data1918 further includes account data 1920 under which the user details arestored.

The user can either opt for a trial account or can make payment based ontype of account or subscription chosen by the user. Alternatively, thepayment can be based on product or number of products chosen by theuser. Based on payment details of the user, user operational profile1922 is generated by entitlement engine 1924. User operational profile1922 is stored in data storage unit 1912 and indicates entitlement ofthe user to various products or services. User operational profile 1922also indicates type of user, i.e. free, trial, student, discounted, orpaid.

In some embodiment, user management engine 1916 and entitlement engine1924 can be one single engine performing the functionalities of both theengines.

The user can then install various applications supported by creativeapparatus 1908 via an application download management engine 1926.Application installers or application programs 1928 present in datastorage unit 1912 are fetched by application download management engine1926 and made available to the user directly or via the applicationmanager. In one embodiment, an indication of all application programs1928 are fetched and provided to the user via an interface of theapplication manager. In another embodiment, an indication of applicationprograms 1928 for which the user is eligible based on user's operationalprofile are displayed to the user. The user then selects applicationprograms 1928 or the applications that the user wants to download.Application programs 1928 are then downloaded on user device 1902A bythe application manager via the application download management engine1926. Corresponding data regarding the download is also updated in useroperational profile 1922. Application program 1928 is an example of thedigital tool. Application download management engine 1926 also managesthe process of providing updates to user device 1902A.

Upon download, installation and launching of an application program, inone embodiment, the user is asked to provide the login details. A checkis again made by user management engine 1916 and entitlement engine 1924to ensure that the user is entitled to use the application program. Inanother embodiment, direct access is provided to the application programas the user is already logged into the application manager.

The user uses one or more application programs 1904A-1904N installed onthe user device to create one or more projects or assets. In addition,the user also has a workspace within each application program. Theworkspace, as described herein, includes setting of the applicationprogram, setting of tools or setting of user interface provided by theapplication program, and any other setting or properties specific to theapplication program. Each user can have a workspace. The workspace, theprojects, and/or the assets can be stored as application program data1930 in data storage unit 1912 by synchronization engine 1932.Alternatively or additionally, such data can be stored at the userdevice, such as user device 1902A.

Application program data 1930 includes one or more assets 1940. Assets1940 can be a shared asset which the user wants to share with otherusers or which the user wants to offer on a marketplace. Assets 1940 canalso be shared across multiple application programs 1928. Each assetincludes metadata 1942. Examples of metadata 1942 include, but are notlimited to, font, color, size, shape, coordinate, a combination of anyof these, and the like. In addition, in one embodiment, each asset alsoincludes a file. Examples of the file include, but are not limited to,image 1944, text 1946, video 1948, font 1950, document 1952, acombination of any of these, and the like. In another embodiment, anasset only includes metadata 1942.

Application program data 1930 also include project data 1954 andworkspace data 1956. In one embodiment, project data 1954 includesassets 1940. In another embodiment, assets 1940 are standalone assets.Similarly, workspace data 1956 can be part of project data 1954 in oneembodiment while it may be standalone data in other embodiment.

A user can operate one or more user device to access data. In thisregard, application program data 1930 is accessible by a user from anydevice, including a device which was not used to create assets 1940.This is achieved by synchronization engine 1932 that stores applicationprogram data 1930 in data storage unit 1912 and enables applicationprogram data 1930 to be available for access by the user or other usersvia any device. Before accessing application program data 1930 by theuser from any other device or by any other user, the user or the otheruser may need to provide login details for authentication if not alreadylogged in. In some cases, if the user or the other user are logged in,then a newly created asset or updates to application program data 1930are provided in real time. Rights management engine 1936 is also calledto determine whether the newly created asset or the updates can beprovided to the other user or not. Workspace data 1956 enablessynchronization engine 1932 to provide a same workspace configuration tothe user on any other device or to the other user based on rightsmanagement data 1938.

In various embodiments, various types of synchronization can beachieved. For example, the user can pick a font or a color from userdevice 1902A using a first application program and can use the font orthe color in a second application program on any other device. If theuser shares the font or the color with other users, then the other userscan also use the font or the color. Such synchronization generallyhappens in real time. Similarly, synchronization of any type ofapplication program data 1930 can be performed.

In some embodiments, user interaction with applications 1904 is trackedby application analytics engine 1958 and stored as application analyticsdata 1960. Application analytics data 1960 includes, for example, usageof a tool, usage of a feature, usage of a workflow, usage of assets1940, and the like. Application analytics data 1960 can include theusage data on a per user basis and can also include the usage data on aper tool basis or per feature basis or per workflow basis or any otherbasis. Application analytics engine 1958 embeds a piece of code inapplications 1904 that enables the application to collect the usage dataand send it to application analytics engine 1958. Application analyticsengine 1958 stores the usage data as application analytics data 1960 andprocesses application analytics data 1960 to draw meaningful output. Forexample, application analytics engine 1958 can draw an output that theuser uses “Tool 4” a maximum number of times. The output of applicationanalytics engine 1958 is used by personalization engine 1962 topersonalize a tool menu for the user to show “Tool 4” on top. Othertypes of personalization can also be performed based on applicationanalytics data 1960. In addition, personalization engine 1962 can alsouse workspace data 1956 or user data 1918 including user preferences topersonalize one or more application programs 1928 for the user.

In some embodiments, application analytics data 1960 includes dataindicating status of a project of the user. For example, if the user waspreparing an article in a digital publishing application and what wasleft was publishing the prepared article at the time the user quit thedigital publishing application, then application analytics engine 1958tracks the state. Now when the user next opens the digital publishingapplication on another device, then the user is indicated and the stateand options are provided to the user for publishing using the digitalpublishing application or any other application. In addition, whilepreparing the article, a recommendation can also be made bysynchronization engine 1932 to incorporate some of other assets saved bythe user and relevant for the article. Such a recommendation can begenerated using one or more engines, as described herein.

Creative apparatus 1908 also includes community engine 1964 whichenables creation of various communities and collaboration among thecommunities. A community, as described herein, includes a group of usersthat share at least one common interest. The community can be closed,i.e., limited to a number of users or can be open, i.e., anyone canparticipate. The community enables the users to share each other's workand comment or like each other's work. The work includes applicationprogram data 1940. Community engine 1964 stores any data correspondingto the community, such as work shared on the community and comments orlikes received for the work as community data 1966. Community data 1966also includes notification data and is used for notifying other users bythe community engine in case of any activity related to the work or newwork being shared. Community engine 1964 works in conjunction withsynchronization engine 1932 to provide collaborative workflows to theuser. For example, the user can create an image and can request for someexpert opinion or expert editing. An expert user can then either editthe image as per the user liking or can provide expert opinion. Theediting and providing of the expert opinion by the expert is enabledusing community engine 1964 and synchronization engine 1932. Incollaborative workflows, a plurality of users is assigned differenttasks related to the work.

Creative apparatus 1908 also includes marketplace engine 1968 forproviding marketplace to one or more users. Marketplace engine 1968enables the user to offer an asset for selling or using. Marketplaceengine 1968 has access to assets 1940 that the user wants to offer onthe marketplace. Creative apparatus 1908 also includes search engine1970 to enable searching of assets 1940 in the marketplace. Searchengine 1970 is also a part of one or more application programs 1928 toenable the user to perform search for assets 1940 or any other type ofapplication program data 1930. Search engine 1970 can perform a searchfor an asset using metadata 1942 or the file.

Creative apparatus 1908 also includes document engine 1972 for providingvarious document related workflows, including electronic or digitalsignature workflows, to the user. Document engine 1972 can storedocuments as assets 1940 in data storage unit 1912 or can maintain aseparate document repository (not shown in FIG. 19).

In accordance with embodiments of the present invention, applicationprograms 1928 include an image editing application that facilitatesautomatic synthesis of content-aware fills. In these embodiments, theimage editing application is provided to user device 1902A (e.g., asapplication 1904N) such that the image editing application operates viathe user device. In another embodiment, one or more of a user interface(e.g., user interface 1903A), a patch validity component (e.g., patchvalidity component 1905A) and/or a patch-based synthesizer (e.g.,patch-based synthesizer 1907A) are provided as an add-on or plug-in toan application such as an image editing application, as furtherdescribed with reference to FIG. 1 above. These configurations aremerely exemplary, and other variations for providing storyboardingsoftware functionality are contemplated within the present disclosure.

It is to be appreciated that the engines and working of the engines aredescribed as examples herein, and the engines can be used for performingany step in providing digital experience to the user.

Exemplary Operating Environment

Having described an overview of embodiments of the present invention, anexemplary operating environment in which embodiments of the presentinvention may be implemented is described below in order to provide ageneral context for various aspects of the present invention. Referringnow to FIG. 20 in particular, an exemplary operating environment forimplementing embodiments of the present invention is shown anddesignated generally as computing device 2000. Computing device 2000 isbut one example of a suitable computing environment and is not intendedto suggest any limitation as to the scope of use or functionality of theinvention. Neither should computing device 2000 be interpreted as havingany dependency or requirement relating to any one or combination ofcomponents illustrated.

The invention may be described in the general context of computer codeor machine-useable instructions, including computer-executableinstructions such as program modules, being executed by a computer orother machine, such as a cellular telephone, personal data assistant orother handheld device. Generally, program modules including routines,programs, objects, components, data structures, etc., refer to code thatperform particular tasks or implement particular abstract data types.The invention may be practiced in a variety of system configurations,including hand-held devices, consumer electronics, general-purposecomputers, more specialty computing devices, etc. The invention may alsobe practiced in distributed computing environments where tasks areperformed by remote-processing devices that are linked through acommunications network.

With reference to FIG. 20, computing device 2000 includes bus 2010 thatdirectly or indirectly couples the following devices: memory 2012, oneor more processors 2014, one or more presentation components 2016,input/output (I/O) ports 2018, input/output components 2020, andillustrative power supply 2022. Bus 2010 represents what may be one ormore busses (such as an address bus, data bus, or combination thereof).Although the various blocks of FIG. 20 are shown with lines for the sakeof clarity, in reality, delineating various components is not so clear,and metaphorically, the lines would more accurately be grey and fuzzy.For example, one may consider a presentation component such as a displaydevice to be an I/O component. Also, processors have memory. Theinventor recognizes that such is the nature of the art, and reiteratesthat the diagram of FIG. 20 is merely illustrative of an exemplarycomputing device that can be used in connection with one or moreembodiments of the present invention. Distinction is not made betweensuch categories as “workstation,” “server,” “laptop,” “hand-helddevice,” etc., as all are contemplated within the scope of FIG. 20 andreference to “computing device.”

Computing device 2000 typically includes a variety of computer-readablemedia. Computer-readable media can be any available media that can beaccessed by computing device 2000 and includes both volatile andnonvolatile media, and removable and non-removable media. By way ofexample, and not limitation, computer-readable media may comprisecomputer storage media and communication media. Computer storage mediaincludes both volatile and nonvolatile, removable and non-removablemedia implemented in any method or technology for storage of informationsuch as computer-readable instructions, data structures, program modulesor other data. Computer storage media includes, but is not limited to,RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM,digital versatile disks (DVD) or other optical disk storage, magneticcassettes, magnetic tape, magnetic disk storage or other magneticstorage devices, or any other medium which can be used to store thedesired information and which can be accessed by computing device 2000.Computer storage media does not comprise signals per se. Communicationmedia typically embodies computer-readable instructions, datastructures, program modules or other data in a modulated data signalsuch as a carrier wave or other transport mechanism and includes anyinformation delivery media. The term “modulated data signal” means asignal that has one or more of its characteristics set or changed insuch a manner as to encode information in the signal. By way of example,and not limitation, communication media includes wired media such as awired network or direct-wired connection, and wireless media such asacoustic, RF, infrared and other wireless media. Combinations of any ofthe above should also be included within the scope of computer-readablemedia.

Memory 2012 includes computer-storage media in the form of volatileand/or nonvolatile memory. The memory may be removable, non-removable,or a combination thereof. Exemplary hardware devices include solid-statememory, hard drives, optical-disc drives, etc. Computing device 2000includes one or more processors that read data from various entitiessuch as memory 2012 or I/O components 2020. Presentation component(s)2016 present data indications to a user or other device. Exemplarypresentation components include a display device, speaker, printingcomponent, vibrating component, etc.

I/O ports 2018 allow computing device 2000 to be logically coupled toother devices including I/O components 2020, some of which may be builtin. Illustrative components include a microphone, joystick, game pad,satellite dish, scanner, printer, wireless device, etc. The I/Ocomponents 2020 may provide a natural user interface (NUI) thatprocesses air gestures, voice, or other physiological inputs generatedby a user. In some instances, inputs may be transmitted to anappropriate network element for further processing. An NUI may implementany combination of speech recognition, stylus recognition, facialrecognition, biometric recognition, gesture recognition both on screenand adjacent to the screen, air gestures, head and eye tracking, andtouch recognition (as described in more detail below) associated with adisplay of computing device 2000. Computing device 2000 may be equippedwith depth cameras, such as stereoscopic camera systems, infrared camerasystems, RGB camera systems, touchscreen technology, and combinations ofthese, for gesture detection and recognition. Additionally, thecomputing device 2000 may be equipped with accelerometers or gyroscopesthat enable detection of motion. The output of the accelerometers orgyroscopes may be provided to the display of computing device 2000 torender immersive augmented reality or virtual reality.

Embodiments described herein support automatically synthesizing acontent-aware fill. The components described herein refer to integratedcomponents of an automatic fill synthesis system. The integratedcomponents refer to the hardware architecture and software frameworkthat support functionality using the automatic fill synthesis system.The hardware architecture refers to physical components andinterrelationships thereof and the software framework refers to softwareproviding functionality that can be implemented with hardware embodiedon a device.

The end-to-end software-based automatic fill synthesis system canoperate within the automatic fill synthesis system components to operatecomputer hardware to provide automatic fill synthesis systemfunctionality. At a low level, hardware processors execute instructionsselected from a machine language (also referred to as machine code ornative) instruction set for a given processor. The processor recognizesthe native instructions and performs corresponding low level functionsrelating, for example, to logic, control and memory operations. Lowlevel software written in machine code can provide more complexfunctionality to higher levels of software. As used herein,computer-executable instructions includes any software, including lowlevel software written in machine code, higher level software such asapplication software and any combination thereof. In this regard, theautomatic fill synthesis system components can manage resources andprovide services for the automatic fill synthesis system functionality.Any other variations and combinations thereof are contemplated withembodiments of the present invention.

Having identified various components in the present disclosure, itshould be understood that any number of components and arrangements maybe employed to achieve the desired functionality within the scope of thepresent disclosure. For example, the components in the embodimentsdepicted in the figures are shown with lines for the sake of conceptualclarity. Other arrangements of these and other components may also beimplemented. For example, although some components are depicted assingle components, many of the elements described herein may beimplemented as discrete or distributed components or in conjunction withother components, and in any suitable combination and location. Someelements may be omitted altogether. Moreover, various functionsdescribed herein as being performed by one or more entities may becarried out by hardware, firmware, and/or software, as described below.For instance, various functions may be carried out by a processorexecuting instructions stored in memory. As such, other arrangements andelements (e.g., machines, interfaces, functions, orders, and groupingsof functions, etc.) can be used in addition to or instead of thoseshown.

The subject matter of the present invention is described withspecificity herein to meet statutory requirements. However, thedescription itself is not intended to limit the scope of this patent.Rather, the inventor has contemplated that the claimed subject mattermight also be embodied in other ways, to include different steps orcombinations of steps similar to the ones described in this document, inconjunction with other present or future technologies. Moreover,although the terms “step” and/or “block” may be used herein to connotedifferent elements of methods employed, the terms should not beinterpreted as implying any particular order among or between varioussteps herein disclosed unless and except when the order of individualsteps is explicitly described.

The present invention has been described in relation to particularembodiments, which are intended in all respects to be illustrativerather than restrictive. Alternative embodiments will become apparent tothose of ordinary skill in the art to which the present inventionpertains without departing from its scope.

From the foregoing, it will be seen that this invention is one welladapted to attain all the ends and objects set forth above, togetherwith other advantages which are obvious and inherent to the system andmethod. It will be understood that certain features and subcombinationsare of utility and may be employed without reference to other featuresand subcombinations. This is contemplated by and is within the scope ofthe claims.

What is claimed is:
 1. A computerized method for automaticallysynthesizing a target image to fill a hole in an original image, themethod comprising: providing a user interface configured to: receive afirst user input specifying the hole in the original image to be filled;and receive a second user input indicating a sampling region of theoriginal image from which pixels can be sampled, the sampling regionexcluding the hole; storing the sampling region in a constraint mask;and passing the constraint mask to a patch-based synthesizer configuredto synthesize the target image from patches sampled from the samplingregion specified by the constraint mask; wherein the user interface isconfigured to present the original image with the synthesized targetimage filling the hole.
 2. The method of claim 1, wherein the userinterface is configured to present the original image with an overlayindicating the sampling region of the original image.
 3. The method ofclaim 2, wherein the second user input comprises a brush tool inputmodifying the overlay to modify the sampling region.
 4. The method ofclaim 1, further comprising, upon detecting completion of the seconduser input, automatically updating the constraint mask and passing theupdated constraint mask to the patch-based synthesizer.
 5. The method ofclaim 1, wherein the user interface is configured to present a previewof what the target image will look like prior to completion.
 6. Themethod of claim 5, wherein the preview is a gradually updating previewof the target image synthesized by successive iterations of thepatch-based synthesizer.
 7. The method of claim 1, wherein the userinterface is configured to receive a third user input specifying one ormore similarity transform parameters for synthesizing the target image.8. The method of claim 1, wherein the user interface is configured toreceive: a fourth user input specifying a range over which the patchescan rotate to synthesize the target image; and a fifth user inputspecifying a color adaptation to change brightness and contrast of thepatches to synthesize the target image.
 9. One or more computer storagemedia storing computer-useable instructions that, when used by one ormore computing devices, cause the one or more computing devices toperform operations comprising: accessing a constraint mask specifying acustomizable sampling region of an original image from which pixels canbe sampled, the sampling region excluding a user-specified hole in theoriginal image; synthesizing a target image to fill the hole frompatches sampled from the sampling region specified by the constraintmask; and providing the synthesized target image for presentation of theoriginal image with the synthesized target image filling the hole. 10.The media of claim 9, further comprising, upon completion of a userinput modifying the sampling region, receiving an updated constraintmask corresponding to the modified sampling region, and synthesizing anupdated target image from patches sampled from the modified samplingregion specified by the updated constraint mask.
 11. The media of claim10, wherein synthesizing the updated target image comprises salvagingcomputations from a prior iteration.
 12. The media of claim 9, furthercomprising providing a preview of what the target image will look likeprior to completion.
 13. The media of claim 12, wherein the preview is agradually updating preview of the target image synthesized by successiveiterations of the patch-based synthesizer.
 14. The media of claim 9,further comprising receiving one or more user-specified similaritytransform parameters, wherein the patches are generated using theuser-specified similarity transform parameters.
 15. The media of claim9, wherein synthesizing the target image is performed in a deterministicfill synthesis mode.
 16. A computer system comprising: one or morehardware processors and memory configured to provide computer programinstructions to the one or more hardware processors; an interfacecomponent configured to: receive a first user input specifying a hole inan original image to be filled; and receive a second user inputindicating a sampling region of the original image from which pixels canbe sampled, the sampling region excluding the hole; and a means forsynthesizing a gradually updating target image to fill the hole usingpatches sampled from the sampling region; wherein the interfacecomponent is configured to present the original image with the graduallyupdating target image filling the hole.
 17. The computer system of claim16, wherein the interface component is configured to present theoriginal image with an overlay indicating the sampling region of theoriginal image.
 18. The computer system of claim 17, wherein the seconduser input comprises a brush tool input modifying the overlay, andwherein the means for synthesizing a gradually updating target image isconfigured, upon completion of the brush tool input, to automaticallyupdate the target image based on the modified sampling region.
 19. Thecomputer system of claim 16, wherein the interface component isconfigured to receive one or more user-specified similarity transformparameters, and wherein the means for synthesizing a gradually updatingtarget image is configured to synthesize the target image fromsimilarity transformed patches generated using the user-specifiedsimilarity transform parameters.
 20. The computer system of claim 19,wherein the one or more user-specified similarity transform parameterscomprise a user selection of allowable rotations, scaling and mirroring.